const managerController = require('./managerController')
const memberController = require('./memberController')
const errorHelper = require('../util/errorHelper')

class TokenController {
  constructor() {
    // empty
  }
  // user shop 通用
  async checkToken(token, tokenType) {
    let result = ''
    if (tokenType === 'manager') {
      result = await managerController.checkTokenValid(token)
      return result.managerId
    }
    result = await memberController.checkTokenValid(token)
    return result.memberId
  }
}

module.exports = new TokenController()
